package com.share.device.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.share.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.share.device.mapper.CabinetSlotMapper;
import com.share.device.domain.CabinetSlot;
import com.share.device.service.ICabinetSlotService;

/**
 * 柜机插槽业务层
 * 
 * @author
 * @date 2025-06-25
 */
@Service
public class CabinetSlotServiceImpl extends ServiceImpl<CabinetSlotMapper, CabinetSlot> implements ICabinetSlotService
{
    @Autowired
    private CabinetSlotMapper cabinetSlotMapper;

    /**
     * 查询柜机插槽
     * 
     * @param id 柜机插槽主键
     * @return 柜机插槽
     */
    @Override
    public CabinetSlot selectCabinetSlotById(Long id)
    {
        return cabinetSlotMapper.selectCabinetSlotById(id);
    }

    /**
     * 查询柜机插槽列表
     * 
     * @param cabinetSlot 柜机插槽
     * @return 柜机插槽
     */
    @Override
    public List<CabinetSlot> selectCabinetSlotList(CabinetSlot cabinetSlot)
    {
        return cabinetSlotMapper.selectCabinetSlotList(cabinetSlot);
    }

    /**
     * 新增柜机插槽
     * 
     * @param cabinetSlot 柜机插槽
     * @return 结果
     */
    @Override
    public int insertCabinetSlot(CabinetSlot cabinetSlot)
    {
        cabinetSlot.setCreateTime(DateUtils.getNowDate());
        return cabinetSlotMapper.insertCabinetSlot(cabinetSlot);
    }

    /**
     * 修改柜机插槽
     * 
     * @param cabinetSlot 柜机插槽
     * @return 结果
     */
    @Override
    public int updateCabinetSlot(CabinetSlot cabinetSlot)
    {
        cabinetSlot.setUpdateTime(DateUtils.getNowDate());
        return cabinetSlotMapper.updateCabinetSlot(cabinetSlot);
    }

    /**
     * 批量删除柜机插槽
     * 
     * @param ids 需要删除的柜机插槽主键
     * @return 结果
     */
    @Override
    public int deleteCabinetSlotByIds(Long[] ids)
    {
        return cabinetSlotMapper.deleteCabinetSlotByIds(ids);
    }

    /**
     * 删除柜机插槽信息
     * 
     * @param id 柜机插槽主键
     * @return 结果
     */
    @Override
    public int deleteCabinetSlotById(Long id)
    {
        return cabinetSlotMapper.deleteCabinetSlotById(id);
    }
}
